package Sj01.Test;

import Sj01.entity.Operation;
import Sj01.factory.OperationFactory;

import java.util.Scanner;

public class OperationTest {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入第一个操作数：");
        double x = input.nextDouble();
        System.out.println("请输入操作符：");
        String oper = input.next();
        System.out.println("请输入第二个操作符：");
        double y = input.nextDouble();
        Operation operation = OperationFactory.creatOperation(oper);
        operation.setX(x);
        operation.setY(y);
        double result = operation.getResult();
        System.out.println("结果："+result);
    }
}
